import request from '@/utils/request'

// 查询大学信息列表展示列表
export function listSchools(query) {
  return request({
    url: '/degree/schools/list',
    method: 'get',
    params: query
  })
}

// 查询大学信息列表展示详细
export function getSchools(id) {
  return request({
    url: '/degree/schools/' + id,
    method: 'get'
  })
}

// 新增大学信息列表展示
export function addSchools(data) {
  return request({
    url: '/degree/schools',
    method: 'post',
    data: data
  })
}

// 修改大学信息列表展示
export function updateSchools(data) {
  return request({
    url: '/degree/schools',
    method: 'put',
    data: data
  })
}

// 删除大学信息列表展示
export function delSchools(id) {
  return request({
    url: '/degree/schools/' + id,
    method: 'delete'
  })
}

// 切换是否热门
export function toggleHot(id) {
  return request({
    url: `/degree/schools/toggleHot/${id}`,
    method: 'post'
  })
}

// 切换是否显示
export function toggleShow(id) {
  return request({
    url: `/degree/schools/toggleShow/${id}`,
    method: 'post'
  })}

// 导入Excel文件
export function importSchoolsExcel(formData) {
  return request({
    url: '/degree/schools/importData',
    method: 'post',
    data: formData,
    headers: { 'Content-Type': 'multipart/form-data' }
  })
}

//导入大学图片
export function importSchoolPics() {
  return request({
    url: '/degree/schools/importSchoolPics/',
    method: 'get'
  })
}

//导出大学信息列表展示
export function exportSchools(query) {
  return request({
    url: '/degree/schools/export',
    method: 'get',
    params: query
  })
}